﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using PokerService.Game;


namespace PokerService
{

    [DataContract]
    public class Table
    {
        private Deck deDeck;
        public Table(int tableID, string name, int stackes, int minBuyIn, int pot)
        {
            TableID = tableID;
            Name = name;
            Stackes = stackes;
            MinBuyIn = minBuyIn;
            PlayingList = new List<Player>();
            
            deDeck = new Deck();
            Pot = pot;
        }

        [DataMember]
        public int TableID { get; set; }

        [DataMember]
        public string Name { get; set; }

        [DataMember]
        public int Stackes { get; set; }

        [DataMember]
        public int MinBuyIn { get; set; }

        [DataMember]
        public List<Player> PlayingList { get; set; }
        [DataMember]
        public List<Player> WaitingList { get; set; }

        [DataMember]
        public int Pot { get; set; }

        public bool StartGame()
        {
            if (WaitingList.Count > 0)
            {
                foreach (Player p in WaitingList)
                {
                    //addd player 
                }
            }

            if (PlayingList.Count<2)
            {
                return false;
            }
            ///Todo 
            return true;
        }
    }
}
